package com.atguigu.dao;

import com.atguigu.pojo.Book;
import com.atguigu.pojo.Order;
import com.sun.org.apache.xpath.internal.operations.Or;

import java.util.List;

/**
 * @author YAO
 * @create 2021-05-13 9:38
 */
public interface OrderDao {

    /**
     * 保存订单
     * @param order
     */
    int saveOrder(Order order);

    /**
     * 查询全部订单
     * @return
     */
    List<Order> queryOrders();

    /**
     * 修改订单状态
     * @param orderId
     * @param status
     * @return
     */
    int changeOrderStatus(String orderId, Integer status);


    /**
     * 根据用户编号查询订单信息
     * @param userId
     * @return
     */
    List<Order> queryOrdersByUserId(Integer userId);

    Integer queryForPageTotalCount();

    List<Order> queryForPageItems(int begin, Integer pageSize);

    void deleteOrdersByUserId(Integer userId);

    void deleteOrderItemsByOrderId(String orderId);

    void deleteOrderByOrderId(String orderId);
}
